const express = require('express')
const expressStatic = require('express-static')

let server = express()

server.listen(8080)
let users = {
	zhangsan: 123456,
	blue: 123456,
}
server.get('/login',function(req,res){
	let user = req.query['user']
	let pass = req.query['pass']
	if(users[user] == null){
		res.send({ok: false, msg:'用户不存在'})
	}else if(users[user] != pass){
		res.send({ok: false, msg:'密码错误'})
	}else{
		res.send({ok: true, msg:'成功'})
	}
})

server.use(expressStatic('./www'))